package pers.yurwisher.rubick.common.user;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author yq
 * @date 2021年4月15日 12:22:30
 * @description 用户信息
 * @since V1.0.0
 */
@Data
public class CurrentUser implements Serializable {

    private static final long serialVersionUID = -6528471462814707226L;
    private Long id;
    private String username;
    private String password;
    private String nickname;
    private String avatar;
    private String phone;
    private String mail;
    private Boolean enabled;

    /**
     * 角色
     */
    private List<String> roles;

    /**
     * 数据访问域
     */
    @JSONField(serialize = false)
    private List<Long> dataScopes;

    /**
     * 是否admin
     */
    private Boolean admin;


    public Boolean isAdmin() {
        return admin;
    }
}
